load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "spanconfigmanager",
    srcs = [
        "manager.go",
        "test_helpers.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/spanconfig/spanconfigmanager",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/security/username",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/sql/isql",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
    ],
)

go_test(
    name = "spanconfigmanager_test",
    srcs = [
        "main_test.go",
        "manager_test.go",
    ],
    deps = [
        ":spanconfigmanager",
        "//pkg/base",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/kv/kvserver/closedts",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/spanconfig",
        "//pkg/sql/catalog",
        "//pkg/sql/isql",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_sync//errgroup",
    ],
)
